package com.ruoyi.student.service.impl;

import java.util.Collections;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.student.mapper.StudentRegistrationMapper;
import com.ruoyi.student.domain.StudentRegistration;
import com.ruoyi.student.service.IStudentRegistrationService;

/**
 * 学生注册Service业务层处理
 * 
 * @author ruoyi-mate
 * @date 2025-08-11
 */
@Service
public class StudentRegistrationServiceImpl implements IStudentRegistrationService 
{
    @Autowired
    private StudentRegistrationMapper studentRegistrationMapper;

    /**
     * 查询学生注册
     * 
     * @param id 学生注册主键
     * @return 学生注册
     */
    @Override
    public StudentRegistration selectStudentRegistrationById(String id)
    {
        return studentRegistrationMapper.selectStudentRegistrationById(id);
    }

    /**
     * 查询学生注册列表
     * 
     * @param studentRegistration 学生注册
     * @return 学生注册
     */
    @Override
    public List<StudentRegistration> selectStudentRegistrationList(StudentRegistration studentRegistration)
    {
        return studentRegistrationMapper.selectStudentRegistrationList(studentRegistration);
    }

    /**
     * 新增学生注册
     * 
     * @param studentRegistration 学生注册
     * @return 结果
     */
    @Override
    public int insertStudentRegistration(StudentRegistration studentRegistration)
    {
        studentRegistration.setCreateTime(DateUtils.getNowDate());
        return studentRegistrationMapper.insertStudentRegistration(studentRegistration);
    }

    /**
     * 修改学生注册
     * 
     * @param studentRegistration 学生注册
     * @return 结果
     */
    @Override
    public int updateStudentRegistration(StudentRegistration studentRegistration)
    {
        studentRegistration.setUpdateTime(DateUtils.getNowDate());
        return studentRegistrationMapper.updateStudentRegistration(studentRegistration);
    }

    /**
     * 批量删除学生注册
     * 
     * @param ids 需要删除的学生注册主键
     * @return 结果
     */
    @Override
    public int deleteStudentRegistrationByIds(String[] ids)
    {
        return studentRegistrationMapper.deleteStudentRegistrationByIds(ids);
    }

    /**
     * 删除学生注册信息
     * 
     * @param id 学生注册主键
     * @return 结果
     */
    @Override
    public int deleteStudentRegistrationById(String id)
    {
        return studentRegistrationMapper.deleteStudentRegistrationById(id);
    }

    @Override
    public int batchInsert(List<StudentRegistration> list) {
        return studentRegistrationMapper.batchInsert(list);
    }

    @Override
    public int deleteAll() {
        return 0;
    }

    @Override
    public StudentRegistration selectStudentRegistrationByStudentId(String username) {
        return studentRegistrationMapper.selectStudentRegistrationByStudentId(username);
    }

    @Override
    public List<StudentRegistration> selectStudentRegistrationIdsByCollegeCodes(List<String> collegeCodes, StudentRegistration studentRegistration) {
        return studentRegistrationMapper.selectStudentRegistrationIdsByCollegeCodes(collegeCodes, studentRegistration);
    }

}
